<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Go to archive</title>
		<script src="libs.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		Loading...
		<script type="text/javascript">
			var fs = require('fs');
			
			var kv = get_url_kv(location.href);
			var archive_name = search_url_kv(kv, 'archive');
			archive_name = archive_name.replace('%20', ' ');
			
			var buffer = fs.readFileSync('archives/' + archive_name);
			var db_json = JSON.parse(buffer.toString());
			var current_json = {
				target: archive_name,
			};
			
			fs.writeFileSync('current.json', JSON.stringify(current_json));
			goto_local(db_json.local);
		</script>
	</body>
</html>
